In the field of computer software, security is important. Well known technical measures for protecting the security of software and computer data include what is referred to in the field as “software obfuscation” or “code obfuscation” which protect software from unauthorized use or access by making the software code more obscure than it is in its original form, thus making it harder for a potential attacker to understand it or access it or its contents during execution. In general obfuscation is intended to make it more time consuming to reverse engineer a program, typically to protect the program against hackers or attackers who wish to determine what the software is doing or to alter it. One aspect of software is handling of data and hence obfuscating data is also important.
It is known to obfuscate arrays of data (also referred to as data structures in the field) which are being manipulated by computer software, see “Obfuscate Arrays by Homomorphic Functions” by William Zhu et al., IEEE, 2006, which discloses several methods of software obfuscation using data transformation. The data transformations described there include array index changes, array folding and array flattening. Array folding consists of increasing the dimension of an array in the software code, such as transforming a two dimensional array into one dimensional array. Array flattening decreases the dimensions of an array. It is known to accomplish this through homomorphic obfuscations to obfuscate programs and data through changing the index so the dimension of array in the programs.
New methods of obfuscation are of great interest in the software field and especially methods of obfuscating or protecting data which is being processed in a non-secure environment such as a consumer electronics device or personal computer. This especially occurs in the context of content protection software, which protects digital content such as audio and video material from misuse. Typically at least a portion of this content protection software is executed in a client device such as a mobile telephone, laptop computer, video player, etc. where the device itself is accessible to hackers, as are some of its internal operations.
Computer software is first written as source code which is readable by a person trained to understand programming languages. Generally that source code is then compiled to object code that contains a list of instructions controlling what a computer or computing device does. Generally obfuscation techniques, especially when applied to object code, are independent of the actual source code language used. This is because all source code when compiled results in a binary string of values. Hence obfuscation as described here is applicable to code in all known computer languages.
Hence it is conventional that the obfuscation process is performed at one location or in one computer (machine) after the source code has been written and when it is compiled. The obfuscated code is then transferred to a second computer/processor where it is to be executed after installation in associated memory at the second computer. (Note that the normal execution does not include any “decompiling” since there is no need on a machine-level basis to restore the source code. Decompiling is strictly done for reverse engineering purposes.) At the second (recipient) computer, the obfuscated code is installed and then can be routinely executed by the processor at the second computer. The obfuscated code is executed as is. The obfuscated code may be slower to execute than the original code.
In computer programming, an array is a data structure holding a group of data elements accessible through an index. An array may be fixed-size or static, meaning the array size is set at the creation of the array and cannot expand or shrink thereafter, or an array may be dynamic, meaning that the size of the array can be changed. Typically, an array contains a group of like data elements, or at least data elements of the same size. In the ANSI “C” computer programming language, if for example a programmer has need for 10 integers, a fixed-size array named NUMBERS can be created to hold all 10; a sample line of C language source code to create such an array of integers is “int NUMBERS[10];”. Each individual data element in the array is accessible via an index when the array is called; sample code to access the first data element is NUMBERS [0], the second data element is NUMBERS[1], the third data element is NUMBERS[2], etc. In the popular C (and C++) programming languages, as well as many other languages, array elements are accessed starting at the index number zero. In most programming languages, arrays are stored in a computer in contiguous logical memory location. For example, assume storing an integer requires 32 bits of memory. A ten element array of integers requires 10*32 or 320 bits. Because the array is stored contiguously in one large block, when the second data element NUMBERS[1] is requested, the computer starts at the (logical) memory address of NUMBERS[0] and offsets or skips forward 32 bits to start reading the memory storing the second data element. For the third data element, the computer skips forward another 32 bits and so on.
The NUMBERS example above is a single dimensional array (also called a table). Multidimensional arrays also exist and are structured and behave in a similar way. A sample line of code to create a two dimensional array of integers is “int NUMBERS2D[10][10];”. A two dimensional array is conceptually an array of arrays. Three and higher dimensional arrays exist and are commonly used in programming. The principles described herein may be applied to multidimensional and single dimensional arrays.
FIG. 1 illustrates such an array (table) 10. Array 10 is a fixed-size array containing one hundred 32-bit data elements indexed from 0 to 99. Array 10 as explained above may store any type of information which may be represented digitally and any size of data element, limited only by the computer hardware it is represented in. Passwords, social security numbers, user names, bank account numbers, and the like are all examples of information which may be stored in such an array.